package com.zhilianbao.leyaogo.http.api;

import android.content.Context;

import com.zhilianbao.leyaogo.constants.HttpConfig;
import com.zhilianbao.leyaogo.http.client.LeYaoGoClient;
import com.zhilianbao.leyaogo.utils.Utils;
import com.zhilianbao.okhttputils.callback.Callback;
import com.zhilianbao.okhttputils.model.JsonParams;

/**
 * ClassName: ActivityApi <br>
 * Description: 活动专题<br>
 * Author: Cyarie <br>
 * Created: 2016/11/19 15:03 <br>
 * Update Time：<br>
 * Update Description：<br>
 */
public class ActivityApi {

    /**
     * 获取活动列表
     */
    public static final String METHOD_GET_ACTIVITY_LIST = "activity/getActivityList";

    /**
     * 获取活动详情
     */
    public static final String METHOD_GET_ACTIVITY_DETAIL = "activity/getActivityDetail";


    /**
     * 获取活动专题列表
     *
     * @param context
     * @param shopId   店铺Id
     * @param callback
     */
    public static void getActivityList(Context context, long userId, String shopId, int type, Callback callback) {
        JsonParams jsonParams = new JsonParams();
        jsonParams.put("shopId", shopId);
        jsonParams.put("userId", userId);
        jsonParams.put("type", type);
        LeYaoGoClient.post(context, HttpConfig.BASE_URL + METHOD_GET_ACTIVITY_LIST, jsonParams, callback);

    }

    /**
     * 获取活动详情
     *
     * @param context
     * @param activityId
     * @param callback
     */
    public static void getActivityDetails(Context context, long activityId, int pageNo, int pageSize, Callback callback) {
        JsonParams jsonParams = new JsonParams();
        jsonParams.put("activityId", activityId);
        jsonParams.put("pageNo", pageNo);
        jsonParams.put("pageSize", pageSize);
        jsonParams.put("userId", Utils.isUserLogin(false) ? Utils.getUserLoginInfo().getUserId() : 0);
        LeYaoGoClient.post(context, HttpConfig.BASE_URL + METHOD_GET_ACTIVITY_DETAIL, jsonParams, callback);

    }
}
